<admintpl file="header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="javascript:;">商品列表</a></li>
			<li><a href="{:U('AdminProduct/add',array('id'=>empty($item['id'])?'':$item['id']))}" target="_self">新增商品</a></li>
		</ul>
        <form class="well form-search" method="post" action="{:U('AdminProduct/index')}">
            <select name="s_tid">
                <option value="">全部</option>
                <foreach name="type_list" item="titem">

                    <option <if condition="$s_tid == $titem['id']">selected</if> value="{$titem.id}">
                        {$titem.title}
                    </option>
                </foreach>
            </select> &nbsp;&nbsp;
            关键字：
            <input type="text" name="keyword" style="width: 200px;" value="{$keyword}" placeholder="请输入关键字...">
            <input type="submit" class="btn btn-primary" value="搜索" />
            <a class="btn btn-danger" href="{:U('AdminProduct/index')}">清空</a>
        </form>
		<form class="js-ajax-form" action="" method="post">

			<table class="table table-hover table-bordered table-list">
				<thead>
					<tr>
                        <th width="50">所属分类</th>
                        <th width="50">首页热门分类</th>
						<th width="50">商品名称</th>
						<th width="100">商品图片</th>
                        <th width="50">是否是夏季常用药</th>
                        <th width="50">是否推荐</th>
                        <th width="50">创建时间</th>
						<th width="70">{:L('ACTIONS')}</th>
					</tr>
				</thead>
				<foreach name="list" item="vo">
				<tr>
                    <td><b>{$vo.title}</b></td>
                    <td>
                        <if condition="$vo['home_type'] == 1">
                            首页热门分类-1
                        <elseif condition="$vo['home_type'] == 2"/>
                            首页热门分类-2
                        <else/>
                        无
                        </if>
                    </td>
                    <td>{$vo.pname}</td>
                    <td>
                        <php>
                            $pictures = explode(",",$vo['pictures']);
                            $picture = sp_get_image_preview_url($pictures[0]);
                        </php>
                        <img src="{$picture}" width="100">
                    </td>
                    <td><if condition="$vo.is_hot == 1">是<else/>否</if></td>
                    <td><if condition="$vo.is_recommend == 1">是<else/>否</if></td>
					<td>{$vo.create_time}</td>
					<td>
						<a href="{:U('AdminProduct/add',array('id'=>$vo['id']))}">{:L('EDIT')}</a> |
						<a href="{:U('AdminProduct/delete',array('id'=>$vo['id']))}" class="js-ajax-delete">{:L('DELETE')}</a>
					</td>
				</tr>
				</foreach>

			</table>

			<div class="pagination">{$page}</div>
		</form>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
	<script>
		function refersh_window() {
			var refersh_time = getCookie('refersh_time');
			if (refersh_time == 1) {
				window.location = "{:U('AdminPost/index',$formget)}";
			}
		}

	</script>
</body>
</html>